<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/5/13
 * Time: 20:28
 */

namespace app\domain;


use app\server\VioUser;

class violation
{
    public function addUserViolationInfo($data, $driving_info) {

        $driving_obj = (array)json_decode($driving_info[1]);
        $driving_data = (array)$driving_obj['Data'];
        $data_drive = [
            'car_code' => $driving_data['plate_num'],
            'car_type' => $driving_data['vehicle_type'],
            'car_owner' => $driving_data['owner'],
            'address' => $driving_data['address'],
            'use_type' => $driving_data['useCharacter'],
            'model_type' => $driving_data['model'],
            'class_code' => $driving_data['vin'],
            'engine_code' => $driving_data['engine_num'],
            'register_time' => (date('Y-m-d H:i:s', strtotime($driving_data['register_date']))),
        ];

        $data = array_merge($data, $data_drive);

        $vioModel = new VioUser();

        $res = $vioModel->addUserInfo($data);

        return $res;
    }

    public function getUserRankList($where, $page) {

        $vioModel = new VioUser();

        $data = $vioModel->getUserRankList($where, $page);

        return $data;
    }
}